let shareInfoModel = require("../../model/blog/shareTable");
let Service = {
    add: (info) => { return shareInfoModel.insertMany([info]) },
    query: (info) => { return shareInfoModel.find(info).sort({ index: -1 }) },
    delete: (info) => { return shareInfoModel.remove(info) },
    update: (info) => { return shareInfoModel.updateOne({ _id: info._id }, info) },
    //设置redNum
    updateRedNum: ({ _id, readNum }) => shareInfoModel.updateOne({ _id }, { $set: { readNum } })
};
module.exports = Service;
